<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>公告栏切换</title>
    <style type="text/css">
        #newslist {
            background: #f8f8f8;
            border: 1px solid silver;
            padding: 1px;
            height: 20px;
            line-height: 20px;
            width: 288px;
        }
        #contain {
            font-size: 12px;
            overflow: hidden;
            list-style: none;
            width: 288px;
            height: 20px;
            margin: 0px;
            padding: 0;
        }
        #contain li {
            height: 22px;
            line-height: 22px;
            white-space: nowrap;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div id="newslist">
        <ul id="contain">
            <li><a href="http://www.baidu.com">百度，世界最大的中文搜索引擎</a></li>
            <li><a href="http://www.csdn.net">CSDN，中国最聚人气的IT技术社区</a></li>
            <li><a href="https://juejin.im/timeline">掘金,帮助开发者成长社区</a></li>
            <li><a href="http://www.sina.com">新浪，中国第一门户网站</a></li>
        </ul>
    </div>
    <script>
        function xx() {
            var container = document.getElementById("contain");
            container.appendChild(container.firstChild);
        }
        setInterval("xx()", 1500);
    </script>
</body>

</html>